CC = g++
CFLAGS = -c -Wall -O2 -fno-exceptions -fno-rtti
LDFLAGS = -lGL -lSDL -lGLU -lX11 -lpthread -lrt -lGLEW -Wl,--gc-sections
OBJECTS = ./bin/component.o ./bin/main.o ./bin/sound.o ./bin/sync.o ./bin/system.o ./bin/Vector.o ./bin/cBackground.o ./bin/cCubeTree.o ./bin/cNoise.o

all: tazmania
	
tazmania: $(OBJECTS) 
	@echo Linking tazmania with $<
	$(CC) -o $@ $(OBJECTS) $(LDFLAGS)

bin/%.o: src/%.cpp
	@echo Compiling $< to $@
	$(CC) -o $@ $< $(CFLAGS)
	
clean:
	@echo Cleaning upp 
	rm bin/*

release : tazmania.64k

tazmania.64k : tazmania
	upx -9 -o tazmania.64k tazmania
